/*
 **全局注册组件
 ** 放在components/global文件夹下
 */
const modulesFiles = import.meta.glob('/src/components/*.vue');
const globalResult = Object.keys(modulesFiles).filter(item => true);
export default app => {
  globalResult.forEach(async (item) => {
    const component = modulesFiles[item];
    const componentItem = await component()
    const componentFile = item.substring(item.lastIndexOf('/') + 1, item.length);
    const componentName = componentFile.replace('.vue', '');
    app.component(componentName, componentItem?.default)
  })
}